<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">

        <title>球票详情</title>
        
        <link rel="stylesheet" type="text/css" href="css/home.css" />
	</head>
	<body id="home" v-cloak>
		<!--球票详情-->
        <section class="p-wapper">
        	<div class="ticket-details">
    			<div class="info">
    				<div class="mark left">{{{items.homeTeam | mark}}}</div>
    				<div class="match">
    					<ul>
	    					<li class="name"><span class="lt">{{items.homeTeam}}</span><span class="grey">VS</span><span class="rt">{{items.visitorTeam}}</span></li>
	    					<li class="time">{{items.matchTime}}  开赛</li>
    					</ul>
    				</div>
    				<div class="mark right">{{{items.visitorTeam | mark}}}</div>
    			</div>
    			<div class="code-box"><div class="code"></div></div>
    			<div class="details">
    				<dl>
    					<dt>取票密码：</dt>
    					<dd>{{items.getTicketPwd}}</dd>
    				</dl>
    				<dl>
    					<dt>取票地点：</dt>
    					<dd>南京奥体中心[{{items.entranceName}}]</dd>
    				</dl>
    				<dl>
    					<dt>检票口： </dt>
    					<dd>{{items.entranceName}}</dd>
    				</dl>
        			<div class="tips">(可凭取票密码、二维码、身份证取票)</div>
        		</div>
    		</div>
    		<div class="seat-list">
    			<div class="info">
    				<p class="lt"><span>{{items.payAmount}}元散客票</span><span>{{items.regionCode}}区</span><span>共{{items.persons.length}}张</span></p>
    				<p><span>联系人：{{items.ticketPhone}}</span></p>
    			</div>
    			<div class="item" v-for="item in items.persons">
    				<p class="lt">{{item.rowCode}}排{{item.colCode}}座</p>
    				<p class="card">{{item.name}}({{item.personId}})</p>
    				<p class="rt" :class="{black : item.isPrinted=='Y'}">{{item.isPrinted | print}}</p>
    			</div>
    		</div>
        </section>
        
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/vue.min.js"></script>
        <script type="text/javascript" src="js/vue-config.js"></script>
        <script type="text/javascript" src="js/jquery.qrcode.min.js"></script>
        <script type="text/javascript" src="js/common.js"></script>
        <script src="https://passport.suning.com/ids/js/passport.js"></script>
        
        <script type="text/javascript">
        	var vm = new Vue({
                el: '#home',
                data: {
	                items: [],
	                returnTag:"",
	                
                    err: false,
                    errCtt: ""
                },
                computed: {
                    
                },
                methods: {
                	
                },
                ready: function(){
                	var param = window.location.search;
                	var index = param.indexOf("orderCode");
                	if(index!=-1){
                		orderCode = param.substring(index+10);
                	}
                	
                    $.ajax({
                    	type: "post",
                    	dataType: "jsonp",
                        url: Suningmatch.DI.orderDetail,
//                      url: "js/getNewest.json",
                        data: {
                        	orderCode: orderCode
                        },
                        success: function(data){
                        	console.log(data);
                        	vm.returnTag = data.returnTag;
                        	
                            if(data.returnTag=="0"){
                            	vm.items = data;
                            	$(".code").qrcode(data.url);
                            }else{
                            	location.href = "404.html";
                            }
                        },
                        error: function(err){
                            vm.errCtt = "系统异常";
                            vm.err = true;
                            var timer = setTimeout(function(){
                                vm.err = false;
                                
                                clearTimeout(timer);
                                timer = null;
                            }, 2000);
                        }
                    });

                }
            });
        </script>
	</body>
</html>
